import request from '@/utils/request'

// 创建培训记录
export function createTrainingRecord(data) {
  return request({
    url: '/biz/training-record/create',
    method: 'post',
    data: data
  })
}

// 更新培训记录
export function updateTrainingRecord(data) {
  return request({
    url: '/biz/training-record/update',
    method: 'put',
    data: data
  })
}

// 删除培训记录
export function deleteTrainingRecord(id) {
  return request({
    url: '/biz/training-record/delete?id=' + id,
    method: 'delete'
  })
}
export function selectTrainingRecord(query) {
  return request({
    url: '/biz/training-record/selectTrainingRecord',
    method: 'get',
    params: query
  })
}

// 获得培训记录
export function getTrainingRecord(id) {
  return request({
    url: '/biz/training-record/get?id=' + id,
    method: 'get'
  })
}

// 获得培训记录分页
export function getTrainingRecordPage(query) {
  return request({
    url: '/biz/training-record/page',
    method: 'get',
    params: query
  })
}

// 导出培训记录 Excel
export function exportTrainingRecordExcel(query) {
  return request({
    url: '/biz/training-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
